package ru.compscicenter.uno.wizard;

import ru.compscicenter.uno.GameSettings;
import ru.compscicenter.uno.log.Logger;

/**
 * User: SLeeP
 * Date: 11.04.12
 * Time: 3:05
 */
public class WizardGUI {
    GameSettings gameSettings;

    public WizardGUI() {
        gameSettings = new GameSettings();
    }

    public void start() {
        Wizard wizard = new Wizard(gameSettings);
        wizard.getDialog().setTitle("UNO");

        Panel1Descriptor descriptor1 = new Panel1Descriptor(gameSettings);
        wizard.registerWizardPanel(Panel1Descriptor.IDENTIFIER, descriptor1);
        gameSettings.panel1 = descriptor1;

        Panel2ClientDescriptor descriptor2client = new Panel2ClientDescriptor(gameSettings);
        wizard.registerWizardPanel(Panel2ClientDescriptor.IDENTIFIER, descriptor2client);
        gameSettings.panel2client = descriptor2client;

        Panel2ServerRulesDescriptor descriptor2server = new Panel2ServerRulesDescriptor(gameSettings);
        wizard.registerWizardPanel(Panel2ServerRulesDescriptor.IDENTIFIER, descriptor2server);
        gameSettings.panel2server = descriptor2server;

        Panel3ClientRulesDescriptor descriptor3client = new Panel3ClientRulesDescriptor(gameSettings);
        wizard.registerWizardPanel(Panel3ClientRulesDescriptor.IDENTIFIER, descriptor3client);
        gameSettings.panel3client = descriptor3client;

        Panel3ServerWaitDescriptor descriptor3server = new Panel3ServerWaitDescriptor(gameSettings);
        wizard.registerWizardPanel(Panel3ServerWaitDescriptor.IDENTIFIER, descriptor3server);
        gameSettings.panel3server = descriptor3server;

        Panel4ClientWaitDescriptor descriptor4client = new Panel4ClientWaitDescriptor(gameSettings);
        wizard.registerWizardPanel(Panel4ClientWaitDescriptor.IDENTIFIER, descriptor4client);
        gameSettings.panel4client = descriptor4client;

        wizard.setCurrentPanel(Panel1Descriptor.IDENTIFIER);
        wizard.showModalDialog();

        Logger.write("WIZARD: finished", Logger.Mode.ACTION);
    }
}
